package com.sky.mapper;

import com.sky.entity.AddressBook;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface AddressBookMapper {
    /**
     * 查看当前用户地址簿
     * @param addressBook
     * @return
     */
    List<AddressBook> selectAddressBook(AddressBook addressBook);

    /**
     * 插入地址簿
     * @param addressBook
     */
    void insert(AddressBook addressBook);

    /**
     * 根据id查询地址簿
     * @param id
     * @return
     */
    AddressBook getById(Long id);

    /**
     * 修改默认地址
     * @param addressBook
     */
    void updateIsDefaultByUserId(AddressBook addressBook);

    /**
     * 修改地址簿
     * @param addressBook
     */
    void update(AddressBook addressBook);

    /**
     * 根据id删除
     * @param id
     */
    void deleteById(Long id);
}
